#ifndef ClientSocket_class
#define ClientSocket_class

#include "Socket.h"

const int SELF_INCR = 1;
const int SET_ZERO = 0;

class ClientSocket : private Socket
{
	public:
		ClientSocket ();
		virtual ~ClientSocket(){};

		bool conn (std::string host, int port);
		void close () { ::close(m_sock);}
		bool reconn ();
		const ClientSocket& operator << ( const std::string& ) const;
		const ClientSocket& operator >> ( std::string& ) const;
		int sock_fd () const {	return Socket::m_sock; }
		void sock_nonblock (bool b) { Socket::set_non_blocking(b); }
		struct in6_addr get_server_addr6 () { return Socket::get_ipaddr6();}
		void set_connected(bool);
		bool is_connected() { return link_status; }
		void set_info_received(bool b) { received_all_info = b; }
		bool info_received() { return received_all_info; }
		int timer_count(const int inst = -1);
		int kep_alive_times(const int inst = -1);
	private:
		bool link_status;
		bool received_all_info;
		int m_timer_count;
		int m_kep_alive_times;
};

#endif
